﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using LGE;

namespace MagicFight
{
    public class HolyAura : Effect
    {
        Texture2D texture;
        float scale = 1f;
        Vector2 origin;
        float rotation;
        Magic magic;

        public HolyAura(Magic magic)
            : base(magic.caster.position)
        {
            this.magic = magic;
            texture = Engine.Load<Texture2D>("Images\\Magic\\HolyPowerAura");
            origin = new Vector2(texture.Width / 2, texture.Height / 2);
        }

        public override void Update(GameTime gameTime)
        {
            if (!magic.alive) { alive = false; return; }
            position = magic.caster.position;
            rotation += (float)gameTime.ElapsedGameTime.TotalMilliseconds/75;
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, null, Color.White, rotation, origin, scale, SpriteEffects.None, 0);
        }
    }
}

 

